package com.ruoyi.system.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.ruoyi.system.domain.YhCommissionRecord;
import com.ruoyi.system.domain.YhScanCodeRecord;
import com.ruoyi.system.domain.vo.YhCommissionRecordVo;
import com.ruoyi.system.domain.vo.YhScanCodeRecordVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 用户烟盒扫码记录Mapper接口
 * 
 * @author ruoyi
 * @date 2023-06-06
 */
public interface YhScanCodeRecordMapper extends BaseMapper<YhScanCodeRecord>
{

    @Select("SELECT c.*, m.nick_name, m.face FROM yh_scan_code_record c " +
            "LEFT JOIN yh_member m on c.member_id = m.id ${ew.customSqlSegment}")
    List<YhScanCodeRecordVo> listByAdmin(@Param(Constants.WRAPPER) Wrapper<YhScanCodeRecord> queryWrapper);

    @Select("SELECT c.*, d.img_url yh_img_url FROM yh_scan_code_record c " +
            "LEFT JOIN yh_details d on c.yh_details_id = d.id ${ew.customSqlSegment}")
    List<YhScanCodeRecord> listByLoginUser(@Param(Constants.WRAPPER) Wrapper<YhScanCodeRecord> queryWrapper);
}
